package com.maimao.search.client;

import com.github.pagehelper.PageInfo;
import com.maimao.core.constant.ServiceContainer;
import com.maimao.core.interceptor.FeignInterceptor;
import com.maimao.core.model.resp.Result;
import com.maimao.model.goods.vo.GoodsInfo;
import com.maimao.search.client.factory.GoodsFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author MaoLin Wang
 * @date 2020/12/22 7:54 下午
 */
@RequestMapping("/goods/goods")
@FeignClient(contextId = "goodsClient", value = ServiceContainer.GOODS_SERVICE, fallbackFactory = GoodsFallBackFactory.class, configuration = FeignInterceptor.class)
public interface GoodsClient {

    /**
     * 分页查询商品信息
     */
    @GetMapping("/goodsinfo")
    Result<PageInfo<GoodsInfo>> goodsInfoPage(@RequestParam(value = "page", defaultValue = "1") Integer page, @RequestParam(value = "size", defaultValue = "10") Integer size);

    @GetMapping("/goodsinfo-byid")
    Result<GoodsInfo> goodsInfoPageByGoodsId(@RequestParam(value = "goodsId") Long goodsId);
}
